package org.duiduo.receiver;

import lombok.extern.slf4j.Slf4j;
import org.duiduo.constant.BaseConstant;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * Direct直连交换机 监听
 */
@Slf4j
@Component
@RabbitListener(queues = BaseConstant.FANOUT_B)
public class FanoutReceiverB {

    @RabbitHandler
    public void process(Map<String, Object> testMessage) {
        log.info("第一台-FanoutReceiverB消费者收到消息: {}", testMessage.toString());
        System.out.println("第一台-FanoutReceiverB消费者收到消息: " + testMessage.toString());
    }

}
